package org.nowcoder.huawei.other;

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.Arrays;

/**
 * HJ14: 字符串排序
 */
public class HJ14 {
    public static void hj14(String[] args) throws IOException {
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        int n = Integer.parseInt(br.readLine());
        String[] values = new String[n];
        for (int i = 0; i < n; i++) {
            values[i] = br.readLine();
        }
        Arrays.sort(values);
        StringBuilder build = new StringBuilder();
        for (String str : values) {
            //System.out.println(str);
            build.append(str + "\n");
        }
        System.out.print(build.toString());
    }
}
